<template>
  <div class='container'>
    <el-dialog title="预览文章" :visible="isOpen" @close="closes" width="870px">
      <div class="article">
        <div class="articleTitle">
          <h3>{{rowData.title}}</h3>
          <span>{{rowData.createTime | formatDate('yyyy-MM-dd hh:mm:ss')}}</span> <span>{{rowData.username}}</span> <i class="el-icon-view"></i> <span>{{rowData.visits}}</span>
        </div>
        <div class="articleBody">
          <div class="body" v-html="rowData.articleBody">
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    isOpen: {
      type: Boolean,
      default: false
    },
    rowData: {
      type: Object
    }

  },
  methods: {

    // 关闭预览框
    closes () {
      // this.isOpen = false
      this.$emit('update:isOpen', false)
    }
  }
}
</script>

<style scoped >
.article {
  padding: 0 10px 0 10px;
}
.article .articleTitle span {
  margin-right: 8px;
}
.article .articleBody {
  margin-top: 10px;
  background-color: rgb(245, 245, 245);
  border-top: 1px dashed rgb(205, 205, 205);
  padding: 10px 15px 0;
}

</style>
